<!--
 * @LastEditors: 杜康
 * @LastEditTime: 2021-11-17 16:27:12
-->
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>绘制Tutorial案例</title>
</head>

<body>
  <div id="mountNode" />
  <script src="https://gw.alipayobjects.com/os/antv/pkg/_antv.g6-3.7.1/dist/g6.min.js"></script>
  <script>
    // 加载真实数据
    const main = async () => {
      const response = await fetch(
        'https://gw.alipayobjects.com/os/basement_prod/6cae02ab-4c29-44b2-b1fd-4005688febcb.json',
      )
      const remoteData = await response.json()
      // 将图实例化
      const graph = new G6.Graph({
        container: 'mountNode',
        width: 800,
        height: 500,
        // 适应画布大小
        fitView: true,
        // 画布周边留白
        fitViewPadding: [10, 10, 10, 10]
      })
      // 给图设置数值，渲染图
      graph.data(remoteData)
      graph.render()
    }
    main()
  </script>
</body>

</html>